package wang.app.demo.api.user;

import org.springframework.stereotype.Service;
import wang.app.demo.api.entity.User;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author dj.wang
 * @Date 2020/6/23 21:45
 * @Version V1.0
 */
@Service
public class UserService
{
    public User getUserByName(String name)
    {
        return mapDB.get(name);
    }

    static Map<String, User> mapDB = new HashMap<>();

    static
    {
        for (int i = 100; i < 110; i++)
        {
            User u1 = new User(i, "name" + i, "pass" + i, null);
            mapDB.put(u1.getUsername(), u1);
        }
    }
}
